<?php
class TreeUpgradeAction extends SzAbstractAction
{
    Protected $paramTypes = array(
        SzAbstractAction::TYPE_INT,
        SzAbstractAction::TYPE_INT,
    );

    /**
     * @param $userId
     * @param $buildingId
     * @return SzResponse
     * @throws SzException
     */
    public function execute($userId,$buildingId) {
        if (!GameService::get()->verifySysUnlock($userId, GameConst::FUNC_TREE)) {
            return $this->buildResponse(false);
        }
        return $this->buildResponse(array(
           'status' => TreeService::get()->upTree($userId,$buildingId)
        ));
    }
}